export default (key: string, name: string, type?: string, 
  startEventId?: string,endEventId?:string,sequenceFlowId?:string,
  activityId?:string,taskParams?:string,terminateEventDefinitionId?:string): string => {
  return `<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
  xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
  targetNamespace="http://bpmn.io/schema/bpmn"
  id="Definitions_${key}">
  <bpmn:process id="${key}" name="${name}" isExecutable="true">
    <bpmn:startEvent id="${startEventId}">
      <bpmn:outgoing>${sequenceFlowId}</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:endEvent id="${endEventId}">
      <bpmn:terminateEventDefinition id="${terminateEventDefinitionId}" />
    </bpmn:endEvent>
    <bpmn:userTask id="${activityId}" name="监听事件" activiti:candidateUsers="${taskParams}" activiti:userTaskType="userTask">
      <bpmn:incoming>${sequenceFlowId}</bpmn:incoming>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="${sequenceFlowId}" sourceRef="${startEventId}" targetRef="${activityId}"/>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}">
      <bpmndi:BPMNShape id="${startEventId}_di" bpmnElement="${startEventId}">
        <dc:Bounds x="142" y="112" width="36" height="36"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="${endEventId}_di" bpmnElement="${endEventId}">
        <dc:Bounds x="498" y="112" width="36" height="36"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="${activityId}_di" bpmnElement="${activityId}">
        <dc:Bounds x="280" y="70" width="120" height="120"/>
        <bpmndi:BPMNLabel/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="${sequenceFlowId}_di" bpmnElement="${sequenceFlowId}">
        <di:waypoint x="178" y="130"/>
        <di:waypoint x="280" y="130"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>`
}
